package com.freecat.xmqgct.mvp.ui.holder;

import android.view.View;
import android.widget.LinearLayout;
import android.widget.TextView;

import com.freecat.xmqgct.R;
import com.freecat.xmqgct.mvp.bean.RecordChildBean;

import butterknife.BindView;
import butterknife.ButterKnife;

/**
 * 作者：ChenPeng
 * 时间：2019/11/19
 * 注释：
 */
public class RecordChildHolder {
    @BindView(R.id.ll_qyjl)
    LinearLayout llQyjl;
    @BindView(R.id.tv_qy_bh)
    TextView tvQyBh;
    @BindView(R.id.tv_qy_cd)
    TextView tvQyCd;
    @BindView(R.id.tv_divider)
    TextView tvDivider;

    @BindView(R.id.tv_qy_qzsd)
    TextView tv_qy_qzsd;

    public RecordChildHolder(View view) {
        ButterKnife.bind(this, view);
    }

    public void setModel(RecordChildBean model, int position, int size) {

        tvQyBh.setText(model.getQybh() + "(" + model.getQylx() + ")");
        tv_qy_qzsd.setText("取样起止深度："+model.getQyqzsd()+"m");
        tvQyCd.setText("取样长度：" + model.getQycd() + "m");
        if (size == position || position == size - 1) {
            tvDivider.setVisibility(View.GONE);
        } else {
            tvDivider.setVisibility(View.VISIBLE);
        }
    }
}
